﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Linq;
using System.Xml;
using Aulac.Global.Enums; using Aulac.Global.Data; using Aulac.Global.Common; using Aulac.Global.Xml;
using Aulac.Rsc.Ems; using Aulac.Rsc.Ems.Tags;

using Aulac.Client.Data.Ems.Helper.DataItems;
using Aulac.Verb.Ems;
using Aulac.Client.Data.Helper;
using Aulac.Rsc;
using Aulac.Global.AccessRight;

namespace Aulac.Client.Ems.WinForm.Stores
{
    public partial class FormTranferMdnStore : Aulac.Client.Controls.Forms.Ems.FormEmsDataVchBase
    {
        public FormTranferMdnStore()
        {
            InitializeComponent();
            Init();
            SetFileMember();
        }
        private void txtTaxRate_TextChanged(object sender, EventArgs e)
        {
            grdLine.CalcAllRowsAmtItemLine(tagVch.Inv.TaxRate);
        }        
        private void cbStore_ValueControlChanged(object sender, EventArgs e)
        {
            if (cboRecStore.StorePrkID == cboRelsStore.StorePrkID)
            {

            }
        }
        private void cboRecStore_ValueControlChanged(object sender, EventArgs e)
        {

        }

        private void tabControlBase_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (tabControlBase.SelectedTab == tabPgList)
                InitGrdInfo();
        }

        private void cboObjRels_ValueObjChange(object sender, EventArgs e)
        {
            if ((!cboObjRels.ComboObjectTyeps.IsEmptyValue) && (!ValueHelper.isEmpty(cboObjRels.ObjPrkID)))
            {
                cboRelsStore.LstStoreTypes = null;
                int s = (int)ValueHelper.ChangeType(cboObjRels.ObjTypeID, typeof(int));
                cboRelsStore.LstObjPrkID = new List<string>() { cboObjRels.ObjPrkID };
                cboRelsStore.LstObjTypeID = new List<string>() { s.ToString() };
                if (!cboRelsStore.IsEmptyDataInList && cboRelsStore.IsEmptyValue)
                    cboRelsStore.ComBoboxData.SelectedIndex = 0;
            }
            else
                cboRelsStore.ClearDataContainer();
        }

        private void cboObjRec_ValueObjChange(object sender, EventArgs e)
        {
            if ((!cboObjRec.ComboObjectTyeps.IsEmptyValue) && (!ValueHelper.isEmpty(cboObjRec.ObjPrkID)))
            {
                cboRecStore.LstStoreTypes = null;
                int s = (int)ValueHelper.ChangeType(cboObjRec.ObjTypeID, typeof(int));
                cboRecStore.LstObjPrkID = new List<string>() { cboObjRec.ObjPrkID };
                cboRecStore.LstObjTypeID = new List<string>() { s.ToString() };
                if (!cboRecStore.IsEmptyDataInList && cboRecStore.IsEmptyValue)
                    cboRecStore.ComBoboxData.SelectedIndex = 0;
            }
            else
                cboRecStore.ClearDataContainer();
        }
    }
}
